<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>评论</title>
<link rel="stylesheet" type="text/css" href="css/home.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="iecss.css" />
<![endif]-->
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/home.js"></script>
<script type="text/javascript" src="js/weibo_ajax.js"></script>
<script type="text/javascript" src="js/weibo_counter.js"></script>

<script type="text/javascript">     
//<![CDATA[
$(function(){
var $div_li =$("div.comment_tab_menu ul li");
$div_li.click(function(){
$(this).addClass("selected")            //当前<li>元素高亮
.siblings().removeClass("selected");  //去掉其它同辈<li>元素的高亮
var index =  $div_li.index(this);  // 获取当前点击的<li>元素 在 全部li元素中的索引。
$("div.comment_tab_box > div")   	//选取子节点。不选取子节点的话，会引起错误。如果里面还有div
.eq(index).show()   //显示 <li>元素对应的<div>元素
.siblings().hide(); //隐藏其它几个同辈的<div>元素
}).hover(function(){
$(this).addClass("hover");
},function(){
$(this).removeClass("hover");
})
})
//]]>

$(function(){       
	/*重新计算微博框剩余可输入字数*/
   	$("#speach_content").bind("blur focus keydown keypress keyup", function(){           
   		recount($("#counter"),$("#speach_submit"),$("#speach_content"));       
	});
   	/*重新计算转发框剩余可输入字数*/
   	$("#zhuanfa_info").bind("blur focus keydown keypress keyup", function(){        
   		recount($(this).prev(".zhuanfa_tips").find("#counter"),$(this).next("#zhuanfa_submit"),$(this)); 
	});
 	/*隐藏与打开评论框*/ 
   	$("div#comment_box").hide();

   	$(".weibo_button a:contains('评论')").live('click',function(){
		$(this).parent().nextAll("#comment_box").toggle();
		return false;
	}); 

   	/*关闭与打开转发框*/
	$("#zhuanfa_box").hide();
	
	$(".weibo_button a:contains('转发')").live('click',function(){
		var tWindow = $(this).parent().nextAll("#zhuanfa_box");
		var tFace = $(this).parent().nextAll("#transpond_face");
		$("#mask").toggle();
		showDialog(tWindow,tFace);
		tWindow.toggle();
		return false;
	}); 
	$("#zhuanfa_box .zhuanfa_titlebox .zhuanfa_close a").click(function(){
		$(this).parents("#zhuanfa_box").hide();
		$(this).parents("#zhuanfa_box").nextAll("#transpond_face").hide();
		$("#mask").hide();
	});
	/*打开转发框表情框*/
	$("#zhuanfa_box #speach_expression").click(function(){
		$(this).parent().next("#transpond_face").toggle();
		return false;
	});
	$("#transpond_face .face_close").click(function(){
		$("#transpond_face").hide();	
	});
	/*
	*根据当前页面与滚动条位置，设置转发框的top与left
	*/
	function showDialog(subWindow,face){
		var objW = $(window);	//当前窗口
		var objT = subWindow;	//要显示的对话框
		var objF = face;
		var brsW = objW.width();	//当然窗口的宽
		var brsH = objW.height();	//当前窗口的高
		var sclL = objW.scrollLeft();	//当前窗口滚动条相对最左位置
		var sclT = objW.scrollTop();	//当前窗口滚动条相对最上位置
		var curW = objT.width();	//对话框的宽
		var curH = objT.height();	//对话框的高

		//计算对话框居中时的左边距
		var tLeft = sclL + (brsW - curW) / 2;
		//计算对话框居中时的上边距
		var tTop = sclT + (brsH - curH) / 2;
		//表情框左边距
		var fLeft = sclL + (brsW - curW) / 2;
		//表情框上边距
		var fTop = sclT + (brsH - curH) / 2 + curH + 10;
		//设置对话框在页面中的位置
		objT.css({"left": tLeft, "top": tTop});
		objF.css({"left": fLeft, "top": fTop, "width": curW});
	}
	/*当前窗口大小改变时，改变转发框的位置*/
	$(window).resize(function()	{
		if(!$("#zhuanfa_box").is(":visible")) {
			return;
		}
		showDialog($("#zhuanfa_box"),$("#transpond_face"));
	});

	/*打开表情框*/
	$("#speach #speach_expression_w,#speach #speach_expression").click(function(){
		$("#face").toggle();
		return false;
	});
	$(":not(#face,#speach_expression_w,#speach_expression)").click(function(){
		$("#face").hide();
	});
	$(".face_close").click(function(){
		$("#face").hide();	
	});
	
	
	/*微博框插入表情*/
	$("#speach #face .face_content img").click(function(){
		var strL = "[";
		var strR = "]";
		var str = strL + $(this).attr("name") + strR;
		var obj = $("#speach_content").get(0);
		if (document.selection) {
			obj.focus();
		    var sel = document.selection.createRange();
		    sel.text = str;
		} else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') {
				var startPos = obj.selectionStart;
				var endPos = obj.selectionEnd;
				var tmpStr = obj.value;
				obj.value = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
		} else {           
			obj.value += str;
		}
		recount($("#counter"),$("#speach_submit"),$("#speach_content")); 	
	});

	/*转发框插入表情*/
	$("#transpond_face .face_content img").click(function(){
		var strL = "[";
		var strR = "]";
		var str = strL + $(this).attr("name") + strR;
		var obj = $(this).parents("#transpond_face").prev("#zhuanfa_box").find("#zhuanfa_info").get(0);
		if (document.selection) {
			obj.focus();
		    var sel = document.selection.createRange();
		    sel.text = str;
		} else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') {
				var startPos = obj.selectionStart;
				var endPos = obj.selectionEnd;
				var tmpStr = obj.value;
				obj.value = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
		} else {           
			obj.value += str;
		}
		recount($(this).parents("#transpond_face").prev("#zhuanfa_box").find("#counter"),$("#zhuanfa_submit"),$(this).parents("#transpond_face").prev("#zhuanfa_box").find("#zhuanfa_info"));	
	});
	$(".friend_accept a").hover(function(){
		$(this).css("color","#ffffff");
	},function(){
		$(this).css("color","#000000");
		});

	/*搜索框控制*/
	$("#searchinfo").focus(function(){
		$("#searchinfo").val("");
	});
	$("#searchinfo").blur(function(){
		if(!$("#searchinfo").val()){
			$("#searchinfo").val("找微博,找人");
		}
	});
	$("#search").click(function(){
		if(!$("#searchinfo").val()){
			return false;
		}
		else if($("#searchinfo").val() == "找微博,找人"){
			return false;
		}
		else{
			return true;
		}
	});
});  
</script>
</head>
<body onload="startdate(),startTime()">

<?php
include_once 'msg_redirect.php';	/*通过使用cookie，当检查出未登陆，则不予进入home.php，返回index.php*/
if($_COOKIE['TTU'] != "logined"){
	msg_redirect("您还未登录哦！", "index.php");
}?>

<div id="main_container">

	<div id="header" >

       <div class="top_right">
       
            <div class="weather">
              <div class="weather_text" id="date"></div>
              <div class="weather_text" id="time"></div>
              <div class="weather_img">
              <a href="#"><img src="image/w_cloudy.png" border="0" width="60" height="60"/></a></div>
            </div>
            
            <div class="big_banner">
            <a href="#"><img src="image/life.jpg" border="0" width="180" height="100"/></a>
            <a href="#"><img src="image/love.jpg"  border="0" width="180" height="100"/></a>
            <a href="#"><img src="image/reading.jpg" border="0" width="180" height="100"/></a>
         </div>
        
        </div>
    
  
        <div id="logo">
            <a href="index.html"><img src="image/logo.png" alt="" title="" border="0" width="240" height="125" /></a>
	    </div>
        

        

    </div>
    
   <div id="main_content"> 
   
            <div id="menu_tab">
                    <ul id="menu">
                    	<li><a href="home.php">首 页</a></li>
                        <li><a href="#">热 门  <img src="image/more.png" /></a>
                         	<ul>
        						<li><a href="hotpeople.php">微博达人</a></li>
        						<li><a href="hotweibo.php">热门微博</a></li>
      						</ul>
                      </li>
                         <li><a href="#">应 用 <img src="image/more.png" /></a>
                         	<ul>
        						<li><a href="photo.php">相册</a></li>
        						<li><a href="collection.php">收藏</a></li>
                                <li><a href="find.php">找人</a></li>
        						<li><a href="#">我的课表</a></li>
        						<li><a href="#">公文通</a></li>
      						</ul>
                         </li>                                                   
                         <li><a href="my_weibo.php">我的主页</a></li>

                         <li><a href="#">消 息  <img src="image/more.png" /></a>
                         	<ul>
        						<li><a href="comment.php">查看评论</a></li>
        						<li><a href="cencerns_from.php">查看粉丝</a></li>
        						<li><a href="my_concerns.php">查看关注</a></li>
      						</ul>
                         </li>                     
                         <li><a href="#">帐 号  <img src="image/more.png" /></a>
                         	<ul>
        						<li><a href="account_info">帐号设置</a></li>
        						<li><a href="logout.php">注销</a></li>
      						</ul>
                         </li>
                         
                    </ul>

            </div><!-- end of menu tab -->
            
    
    <div class="left_content">
     <div class="title_box">我的状态</div>  
     <div class="border_box">
         <div class="user_title"><?php echo $_COOKIE['u_name'];?></div>
         <div class="user_img"><a href="details.html"><img src="<?php 
							/*用以输出用户端的头像*/
							include_once 'sql_connect.php'; 
    						include_once 'msg_redirect.php';
    						$u_no = $_COOKIE['u_no'];
    						$show_head_sql = mysql_query("select h_data from head where u_no='$u_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "head_image/09.jpg";
    						}
    						else echo "$my_data";
    						?>" width="100" height="100" /></a></div>
         <div class="button_box">
         <div class="button"><a href="my_concerns.php">关注<?php
                           include_once("sql_connect.php");
                           include_once("msg_redirect.php");
  
                            $u_no = $_COOKIE['u_no'];
    						$show_sql = mysql_query("select max(c_num) from concerns where u_no='$u_no'",$connection);
    						$show_result = mysql_fetch_array($show_sql);
    						$my_data = $show_result[0];   						
    						echo "$my_data";
    						  ?></a></div>
         <div class="button"><a href="cencerns_from.php">粉丝<?php
                           include_once("sql_connect.php");
                           include_once("msg_redirect.php");
  
                            $u_no = $_COOKIE['u_no'];
    						$show_sql = mysql_query("select max(f_num) from concerns where c_no='$u_no'",$connection);
    						$show_result = mysql_fetch_array($show_sql);
    						$my_data = $show_result[0];   						
    						echo "$my_data";
    						  ?></a></div>
         <div id="weiboNum_button" class="button"><a href="my_weibo.php">微博<?php
                           include_once("sql_connect.php");
                           include_once("msg_redirect.php");
  
                            $u_no = $_COOKIE['u_no'];
    						$show_sql = mysql_query("select max(w_num) from weibo where u_no='$u_no'",$connection);
    						$show_result = mysql_fetch_array($show_sql);
    						$my_data = $show_result[0];   						
    						echo "$my_data";
    						  ?></a></div>
         </div>
     </div> 
     
     <div class="title_box">关于我</div>
    
        <ul class="left_menu">
        <li class="odd"><a href="home.php">首页</a></li>
        <li class="even"><a href="comment.php">评论</a></li>
         <li class="odd"><a href="collection.php">收藏</a></li>
         <li class="odd"><a href="photo.php">相册</a></li>
         <li class="even"><a href="">课表</a></li>
        </ul> 
             
     
     <div class="title_box">待增加区域</div>
     <div class="banner_adds">
       
       <a href="#"><img src="image/reading.jpg" alt="" title="" border="0" height="180" width="100"/></a>
     </div>    
        
    
   </div><!-- end of left content --> 



   <div class="center_content">	  	
    <div class="comment_tab">
		<div class="comment_tab_menu">
		<ul>
		<li class="selected">收到的评论</li>
		<li>发出的评论</li>
		</ul>
		</div>
	<div class="comment_tab_box">
    	<div>
        <div id="weibo_box"><?php 
    /*收到评论内容*/
    include_once 'sql_connect.php'; 
    include_once 'msg_redirect.php';
	$u_no = $_COOKIE['u_no'];
    
    $my_sql = mysql_query("SELECT weibo.w_content,comment.u_no,comment.c_content,c_date FROM weibo,comment WHERE comment. w_id in(select w_id from weibo where u_no=1) and weibo.w_id=comment.w_id order by c_date desc",$connection);
		
    $my_result = mysql_fetch_array($my_sql);
    if($my_result){
    do{
    ?>
   	<div class="weibo_box">
    	<div class="weibo_img"><a href="#"><img src="<?php 
							/*用以输出用户端的头像*/
							include_once 'sql_connect.php'; 
    						include_once 'msg_redirect.php';
    						$u_no = $my_result['u_no'];
    						$show_head_sql = mysql_query("select h_data from head where u_no='$u_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "head_image/09.jpg";
    						}
    						else echo "$my_data";
    						?>" width="50" height="50" /></a></div>
        <div class="weibo_content">        
        	    <?php 
 
                /*显示昵称*/
                include_once("sql_connect.php");
                   
                $u_no = $my_result['u_no'];
    			$user_sql = mysql_query("select u_name from user_info where u_no='$u_no'",$connection);
    			$user_result = mysql_fetch_array($user_sql);
    			$user_data = $user_result[0];   						 
    		    /*评论内容*/
	    echo "<font color='#06f'>".$user_data."</font>".":"."$my_result[c_content]"."&nbsp;&nbsp;";
	    include_once 'timeConverter.php';echo "(".timeConverter($my_result[c_date]).")</div>";					
	    echo "<div class='weibo_content'>评论"."<font color='#06f'>"."我"."</font>"."的微博".": “".$my_result[w_content]."”";
	    ?>
        </div>
        <div class="comment_button"><a href="javascript:void(0);">回复</a></div>
         
        <div id="comment_box">
        <div class="comment_bg">
        <span id="weibo_id" style="display:none"><?php echo $my_result[w_id];?></span>
        <div contenteditable="true" type="text" name="comment_info" class="comment_info" ></div>
        <input name="speach_submit" class="comment_submit" id="comment_submit" type="button" value="评 论" />
        
   
        <div id="comment_wrap">       
        <?php 	
        /*评论微博显示*/
		include_once 'sql_connect.php';
		include_once 'msg_redirect.php';
		include_once 'timeConverter.php';
        $comment_sql = mysql_query("SELECT c_content,c_date,u_no FROM comment WHERE w_id='$my_result[w_id]'",$connection);	
        $comment_result = mysql_fetch_array($comment_sql);
		if($comment_result){
			do {
		?>
			
			<div class="comment_sbox">
            <div class="comment_border"></div>
			<div class="comment_img"><a href="#"><img src="<?php 
					/*显示头像*/
        			$show_head_sql = mysql_query("select h_data from head where u_no='$comment_result[u_no]'",$connection);
    				$show_head_result = mysql_fetch_array($show_head_sql);
    				$my_data = $show_head_result[h_data];
    				if (!$my_data){
    					echo "head_image/09.jpg";
    					}
    				else echo "$my_data";
					?>" alt="" title="" width="30" height="30" border="0" /></a></div>

					<div class="comment_content">
					<?php 
					/*显示人名*/
					$show_user = mysql_query("select u_name from user_info where u_no = '$comment_result[u_no]'",$connection);
					$show_user_result = mysql_fetch_array($show_user);
					echo $show_user_result[0].":".$comment_result[c_content]."(".timeConverter($comment_result[c_date]).")";?>
					</div>                                        
				</div>
					
		<?php 
				}while ($comment_result = mysql_fetch_array($comment_sql));
			}
		?>
        </div>
        <s><i></i></s>
		</div>
        </div>    
        <div class="weibo_border"></div>            
    </div>
    <?php 
    }while ($my_result=mysql_fetch_array($my_sql));}
	?>
    </div>    
        </div>
        <div style="display:none;">
        <div id="weibo_box"><?php 
    /*发出评论内容*/
    include_once 'sql_connect.php'; 
    include_once 'msg_redirect.php';
	$u_no = $_COOKIE['u_no'];
    
    $my_sql = mysql_query("select weibo.w_content,weibo.u_no,comment.c_content,c_date FROM weibo,comment where weibo.w_id in(select w_id from comment where u_no='$u_no') and comment.w_id in(select w_id from comment where u_no='$u_no') and weibo.w_id=comment.w_id  ",$connection);
		
    $my_result = mysql_fetch_array($my_sql);
    if($my_result){
    do{
    ?>
   	<div class="weibo_box">
    	<div class="weibo_img"><a href="#"><img src="<?php 
							/*用以输出用户端的头像*/
							include_once 'sql_connect.php'; 
    						include_once 'msg_redirect.php';
    						$u_no = $my_result['u_no'];
    						$show_head_sql = mysql_query("select h_data from head where u_no='$u_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "head_image/09.jpg";
    						}
    						else echo "$my_data";
    						?>" width="50" height="50" /></a></div>
        <div class="weibo_content"><span id="weibo_id" style="display:none"><?php echo "$my_result[w_id]";?></span>        
        	    <?php 
 
                /*显示昵称*/
                include_once("sql_connect.php");
                   
                $u_no = $my_result['u_no'];
    			$user_sql = mysql_query("select u_name from user_info where u_no='$u_no'",$connection);
    			$user_result = mysql_fetch_array($user_sql);
    			$user_data = $user_result[0];   						 
    		    /*评论内容*/
	    echo "$my_result[c_content]"."&nbsp;&nbsp;";
	    include_once 'timeConverter.php';echo "(".timeConverter($my_result[c_date]).")</div>";					
	    echo "<div class='weibo_content'>评论"."<font color='#06f'>".$user_data."</font>"."的微博".": “".$my_result[w_content]."”";
	    ?>
        </div>
        <div class="comment_button"><a href="javascript:void(0);">删除</a></div>
        
        <div id="comment_box">
        <div class="comment_bg">
        <span id="weibo_id" style="display:none"><?php echo $my_result[w_id];?></span>
        <div contenteditable="true" type="text" name="comment_info" class="comment_info" ></div>
        <input name="speach_submit" class="comment_submit" id="comment_submit" type="button" value="评 论" />
        
   
        <div id="comment_wrap">       
        <?php 	
        /*评论微博显示*/
		include_once 'sql_connect.php';
		include_once 'msg_redirect.php';
		include_once 'timeConverter.php';
        $comment_sql = mysql_query("SELECT c_content,c_date,u_no FROM comment WHERE w_id='$my_result[w_id]'",$connection);	
        $comment_result = mysql_fetch_array($comment_sql);
		if($comment_result){
			do {
		?>
			
			<div class="comment_sbox">
            <div class="comment_border"></div>
			<div class="comment_img"><a href="#"><img src="<?php 
					/*显示头像*/
        			$show_head_sql = mysql_query("select h_data from head where u_no='$comment_result[u_no]'",$connection);
    				$show_head_result = mysql_fetch_array($show_head_sql);
    				$my_data = $show_head_result[h_data];
    				if (!$my_data){
    					echo "head_image/09.jpg";
    					}
    				else echo "$my_data";
					?>" alt="" title="" width="30" height="30" border="0" /></a></div>

					<div class="comment_content">
					<?php 
					/*显示人名*/
					$show_user = mysql_query("select u_name from user_info where u_no = '$comment_result[u_no]'",$connection);
					$show_user_result = mysql_fetch_array($show_user);
					echo $show_user_result[0].":".$comment_result[c_content]."(".timeConverter($comment_result[c_date]).")";?>
					</div>                                        
				</div>
					
		<?php 
				}while ($comment_result = mysql_fetch_array($comment_sql));
			}
		?>
        </div>
        <s><i></i></s>
		</div>
        </div>     
        <div class="weibo_border"></div>            
    </div>
    <?php 
    }while ($my_result=mysql_fetch_array($my_sql));}
	?>
    </div>		
        </div>
	</div>
	</div>    	     
   
   </div><!-- end of center content -->



 <div class="right_content">
 
     <div class="title_box">搜索感兴趣的</div>  
     <div class="border_box">
		<input type="text" name="searchinfo" class="searchinfo_input" value="找微博,找人"/>
        <a href="#" class="search">搜索&gt;&gt;</a>
     </div>  
     

     
 
   		<div class="friend_box">
        	<div class="title_box">可能认识的人<?php 
    /*循环输出user_info表中没有被u_no关注的人，同时输出头像，昵称*/
    include_once 'sql_connect.php'; 
	$u_no = $_COOKIE['u_no'];    
    $my_sql = mysql_query("SELECT user_info.u_name,h_id,u_no FROM user_info WHERE user_info.u_no NOT IN(SELECT c_no FROM concerns WHERE u_no= '$u_no' ) LIMIT 0,3 ",$connection);
	$my_result = mysql_fetch_array($my_sql);
	
    if($my_result){
    	do{
    ?></div>
            
            <div class="friend_icon"><a href="#" title=""><img src="<?php 
							/*用以输出用户端的头像*/
							include_once 'sql_connect.php'; 
    						$u_no = $my_result['u_no'];
    						$show_head_sql = mysql_query("select h_data from head where u_no='$u_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "head_image/09.jpg";
    						}
    						else echo "$my_data";
    						?>" width="35" height="35" /></a></div>
            
            <div class="friend_details">
            	<a href="javascript:void(0)" class="friend_name"><?php echo "<font color='#06f'>".$my_result[u_name]?> </a><br />
            	<span class="border_f"></span>
            	<div class="friend_accept"><a href="javascript:void(0)">+加关注</a></div>
            	<?php 
               	}while ($my_result=mysql_fetch_array($my_sql));}
	        	?>
            </div>
            
            <a href="#" class="more">更多&gt;&gt;</a>
                 
      </div>
   
   
     <div class="title_box">公文通最新资讯</div>  
     <div class="border_box">
         <div class="user_title">标题</div>
         <div>
           <p><a href="details.html">内容缩写</a></p>
           <p>65465465</p>
           <p>65465465</p>
           <p>65465446</p>
        </div>
         <div><a href="#" class="search">更多&gt;&gt;</a></div>
     </div>  
     
     
     
    <div class="title_box">人气排行</div>
<?php 
       /*新添加代码:人气排行前三*/
	  include_once 'sql_connect.php'; 
    						
      $concerns_sql = mysql_query("select c_no,max(f_num)num from concerns   group by c_no  order by num desc limit 0,8"); 
      $concerns_result = mysql_fetch_array($concerns_sql);
	  $number = 1;
      $i = 0;
      if($concerns_result!=""){
      	do{      		
      ?>
    
        <ul class="right_menu">
      		<?php 
      		if($i==0){
							/*用以输出用户端的头像*/
							include_once 'sql_connect.php'; 
    						$c_no = $concerns_result[0];
    						$show_head_sql = mysql_query("select h_data from head where u_no='$c_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "<li class='odd'><a href=''><img src='head_image/09.jpg' alt='' title='' width='25' height='25' border='0' />";
    						}
    						else echo "<li class='odd'><a href=''><img src='$my_data' alt='' title='' width='25' height='25' border='0' />"; 
                           /*显示昵称*/
                           include_once("sql_connect.php");                   
                            $c_no = $concerns_result[0];
    						$user_sql = mysql_query("select u_name from user_info where u_no='$c_no'",$connection);
    						$user_result = mysql_fetch_array($user_sql);
    						$user_data = $user_result[0];   						
    						echo "&nbsp;$user_data</a></li>";
    						$i++;
      				}
    						  
    	 	else { 		  						
 
							/*用以输出用户端的头像*/
							include_once 'sql_connect.php'; 
    						$c_no = $concerns_result[0];
    						$show_head_sql = mysql_query("select h_data from head where u_no='$c_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "<li class='even'><a href=''><img src='head_image/09.jpg' alt='' title='' width='25' height='25' border='0' />";
    						}
    						else echo "<li class='even'><a href=''><img src='$my_data' alt='' title='' width='25' height='25' border='0' />";
                           /*显示昵称*/
                           include_once("sql_connect.php");                   
                            $c_no = $concerns_result[0];
    						$user_sql = mysql_query("select u_name from user_info where u_no='$c_no'",$connection);
    						$user_result = mysql_fetch_array($user_sql);
    						$user_data = $user_result[0];   						
    						echo "&nbsp;$user_data</a></li>";
    						$i--;
    				}
    		?>
    						

        </ul>      
	  <?php 
        /*新添加代码:人气排行前三，循环语句*/
      	}while($concerns_result = mysql_fetch_array($concerns_sql));
      }
      ?>     
     <div class="banner_adds">
     

     <a href="#"><img src="<?php 
							/*用以输出人气第一用户端的头像*/
							include_once 'sql_connect.php'; 
							
      						$concerns_sql = mysql_query("select c_no,max(f_num)num from concerns   group by c_no  order by num desc "); 
      						$concerns_result = mysql_fetch_array($concerns_sql); 
      						$c_no = $concerns_result[0];   						
							
      						
    						$show_head_sql = mysql_query("select h_data from head where u_no='$c_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "head_image/09.jpg";
    						}
    						else echo "$my_data";
    						?>" alt="" title="" border="0" height="150" width="120"/></a>
     </div>        
     
   </div><!-- end of right content -->   


            
   </div><!-- end of main content -->
   
   
   
   <div class="footer">深圳大学计算机与软件学院@毕业设计项目网站<br />指导老师：王华明<br />项目负责：陈作鑫<br />
    小组成员：陈作鑫&nbsp;&nbsp;陈志杰&nbsp;&nbsp;赖晓东
    </div>                 


</div>
<!-- end of main_container -->
</body>
</html>